<template>
	<view class="pageBg">
		<leader :listData="list" @goodsDetails="goodsDetails"></leader>
	</view>
</template>

<script>
import { pageScroll } from '@/utils/mixins.js';

export default {
	mixins: [pageScroll],

	data() {
		return {
			id: ''
		};
	},
	onLoad({ id }) {
		this.id = id;
		this.init();
	},
	methods: {
		async init() {
			const res = await this.$api.CourseLists({ cid: this.id, ...this.page });
			this.page.count = res.data.count;
			this.list = [...this.list, ...res.data.lists];
		},
		goodsDetails({ item, index }) {
			uni.navigateTo({
				url: '/pages/index/future/detail/detail?id=' + item.id
			});
		}
	}
};
</script>

<style lang="scss"></style>
